<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{$data->name}</title>
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/weui.min.css">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/jquery-weui.css">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/demos.css">
    <script src="__MODULE_LIBS__/js/jquery-2.1.4.js"></script>
    <script src="__MODULE_LIBS__/js/fastclick.js"></script>
    <script src="__MODULE_LIBS__/js/jquery-weui.js"></script>
    <script src="https://cdn.bootcss.com/echarts/3.7.0/echarts.min.js"></script>
    <script src="https://wap.southernfund.com/static/js/ichart.1.2.min.js"></script>
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }

        html {
            width: 100%;
            height: 100%;
            font-size: 20px;
            font-family: "Microsoft YaHei", "宋体", "Segoe UI", "Lucida Grande", Helvetica, Arial, sans-serif, FreeSans, Arimo;
            background: #F3F3F3;
        }

        body {
            margin: 0 auto;
            max-width: 750px;
            width: 100%;
            height: 100%;
            background: #21202D;
            /*background: url(__MODULE_LIBS__/img/probg.png) no-repeat;*/
            /*background-size: 100%;*/
            overflow: hidden;
        }

        li {
            list-style: none;
        }

        /*顶部导航栏处的样式*/
        .navbar {
            position: relative;
            display: -webkit-box !important;
            display: box !important;
            width: 100%;
            height: 2rem;
            font-size: 16px;
            color: #fff;
            line-height: 2rem;
            background: #373553;
        }

        .navbar-item {
            position: absolute;
            left: 0;
            top: 0;
            display: block;
            width: 3.2rem;
            height: 2rem;
            font-size: 14px;
            color: #fff;
            text-align: center;
        }

        .navbar-item > img {
            width: 0.8rem;
            height: 0.7rem;
            vertical-align: middle;
        }

        .navbar-center {
            max-width: 9rem;
            margin: 0 auto;
            text-align: center;
            word-break: keep-all; /* 不换行 */
            white-space: nowrap; /* 不换行 */
            overflow: hidden; /* 内容超出宽度时隐藏超出部分的内容 */
            text-overflow: ellipsis; /* 当对象内文本溢出时显示省略标记(...) */
        }

        /*主体部分的样式*/
        .content {
            width: 100%;
        }

        /*.datelist {*/
        /*display: -webkit-box !important;*/
        /*display: box !important;*/
        /*margin: 0.5rem;*/
        /*font-size: 0.75rem;*/
        /*}*/

        /*.datelist > li {*/
        /*position: relative;*/
        /*float: left;*/
        /*-webkit-box-flex: 1;*/
        /*box-flex: 1;*/
        /*padding: 0.3rem 0;*/
        /*text-align: center;*/
        /*background: #fff;*/
        /*border: 1px #F44444 solid;*/
        /*}*/

        /*.datelist > li:nth-child(1),*/
        /*.datelist > li:nth-child(2),*/
        /*.datelist > li:nth-child(3),*/
        /*.datelist > li:nth-child(4){*/
        /*border-right: 0;*/
        /*}*/

        /*.datelist > li:first-child {*/
        /*border-radius: 0.25rem 0 0 0.25rem;*/
        /*}*/

        /*.datelist > li:last-child {*/
        /*background: #F44444;*/
        /*border-radius: 0 0.25rem 0.25rem 0;*/
        /*}*/

        /*.datelist > li > a {*/
        /*color: #000;*/
        /*}*/

        /*.datelist > li:last-child > a {*/
        /*color: #FFFFFF;*/
        /*}*/

        /*.node {*/
        /*position: relative;*/
        /*margin-top: 0.3rem;*/
        /*margin-right: 0.5rem;*/
        /*float: right;*/
        /*width: 100px;*/
        /*height: 1.5rem;*/
        /*font-size: 0.6rem;*/
        /*text-align: center;*/
        /*line-height: 1.5rem;*/
        /*border: 1px #F44444 solid;*/
        /*border-radius: 1rem;*/
        /*z-index: 10000;*/
        /*}*/

        /*.node > a {*/
        /*display: block;*/
        /*width: 100%;*/
        /*height: 100%;*/
        /*color: #F44444;*/
        /*}*/

        .chartlist {
            /*background: #21202D;*/
        }

        .chartlist > .weui-grids {
            /*background: #21202D;*/
        }

        .chartlist .weui-grid__label {
            font-size: 0.6rem;
            /*color: #ffffff;*/
            color: #21202D;
        }

        .allchart {
            width: 100%;
        }

        #chart {
            margin-top: 10px;
            height: 340px;
            margin-bottom: 3rem;
        }

        .footer {
            position: fixed;
            bottom: 0;
            width: 100%;
            max-width: 750px;
            /*height: 3rem;*/
            padding: 0;
            border-top: 1px #F44444 solid;
        }

        .weui-grids:before, .weui-grids:after, .weui-grid:before, .weui-grid:after {
            border: 0;
        }

        .weui-grids {
            background: #FFFFFF;
        }

        .weui-grid {
            padding: 0.5rem 0.4rem;
        }

        .weui-grid__label {
            font-size: 0.75rem;
        }

        .red {
            font-size: 0.75rem;
            color: #F44444;
            line-height: 1.3;
        }

        .buy {
            font-size: 0.75rem;
            color: #fff;
            line-height: 2.8;
        }

        .buy-dlog,.select-dlog{
            position: fixed;
            top: 0px;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.4);
            z-index: 10000;
            display: none;
        }

        .dlog {
            position: relative;
            top: 8rem;
            left: 0;
            margin: 0 auto;
            padding: 0.5rem;
            width: 13rem;
            height: auto;
            background: #fff;
            border-radius: 0.4rem;
            z-index: 100000;
        }

        .buy-close {
            position: absolute;
            top: 0rem;
            right: 0rem;
            width: 2rem;
            height: 1.4rem;
            text-align: center;
            line-height: 1.4rem;
            cursor: pointer;
        }

        .buyForm {
            margin-top: 0.5rem;
            width: 100%;
            font-size: 0.65rem;
        }

        .buyForm > p {
            display: block;
            width: 100%;
            margin-top: 0.6rem;
            margin-bottom: 0.4rem;
            text-align: center;
        }

        .buyForm input[type="number"] {
            padding-left: 0.3rem;
            width: 8.5rem;
            border: 0;
            border-bottom: 1px #F44444 solid;
            outline: 0;
        }

        .buybtn,.buybtn1,.rongzi {
            width: 5rem;
            height: 1.5rem;
            color: #FFFFFF;
            background: #F44444;
            border: 0;
            border-radius: 0.2rem;
            outline: 0;
            cursor: pointer;
            margin: 0 .5rem;
        }

        .weui-mask {
            z-index: 1000000;
        }

        .weui-dialog {
            z-index: 2000000;
        }
        .weui-grid__label {
            white-space: normal;
        }
    </style>
</head>
<body>
<header class="navbar">
    <a href="{:url('index')}" class="navbar-item">
        <img src="__MODULE_LIBS__/img/back.png"/>{$is_language?'返回':'Return'}
    </a>
    <div class="navbar-center">{$data->name}</div>
    <div class="navbar-item1">
        <select name="" id="yy">
            <option value="1" {$is_language?'selected':''}>中文</option>
            <option value="0" {$is_language?'':'selected'}>English</option>
        </select>
    </div>
</header>
<div class="content">
    <div class="chartlist">
        <div class="weui-grids">
            <a href="" class="weui-grid js_grid" style="width: 25%;">
                <p class="weui-grid__label">
                    {$is_language?'昨日涨幅价':'Yesterday s price increase'}
                </p>
                <p class="weui-grid__label">
                    <?php
                            if(isset($history['proportion'])){
                                echo $history['proportion'];
                            }
                    ?>
                </p>
            </a>
            <a href="" class="weui-grid js_grid" style="width: 25%;">
                <p class="weui-grid__label">
                    {$is_language?'历史最高价':'Lifetime high price'}
                </p>
                <p class="weui-grid__label">
                    ${$history['highest']?$history['highest']:0}
                </p>
            </a>
            <a href="" class="weui-grid js_grid" style="width: 25%;">
                <p class="weui-grid__label">
                    {$is_language?'历史最低价':'Lowest historical price'}
                </p>
                <p class="weui-grid__label">
                    ${$history['minimum']?$history['minimum']:0}
                </p>
            </a>
            <a href="" class="weui-grid js_grid" style="width: 25%;">
                <p class="weui-grid__label">
                    {$is_language?'历史平均价':'Historical average price'}
                </p>
                <p class="weui-grid__label">
                    ${$history['average']?$history['average']:0}
                </p>
            </a>
        </div>
    </div>
    <input type="hidden" value="{$data.id}" id="hidid">
    <div class="allchart">
        <div id="chart"></div>
    </div>
</div>
<footer class="footer">
    <div class="weui-grids">

        {if $_SESSION['dolphin_admin_']['home_user']['id']==$data['user_id']}
        <a href="javascript:;" class="weui-grid" style="width: 50%">
            <p class="red">{$data->money}</p>
            <p class="weui-grid__label">{$is_language?'當前價格':'Current price'}</p>
        </a>
        <a href="{:url('set_goods_ruls',['id'=>$data.id])}" class="weui-grid" style="background: #F44444;width: 50%;">
            <p class="buy">{$is_language?'設置價格節點':'Setting price'}</p>
        </a>

        {elseif $_SESSION['dolphin_admin_']['home_user']['group_id']==2}
        <a href="javascript:;" class="weui-grid" style="width: 100%;">
            <p class="red">{$data->money}</p>
            <p class="weui-grid__label">{$is_language?'當前價格':'Current price'}</p>
        </a>
        {/if}
        {if $_SESSION['dolphin_admin_']['home_user']['group_id']!=2}
        <a href="javascript:;" class="weui-grid" style="width: 50%;">
            <p class="red">{$data->money}</p>
            <p class="weui-grid__label">{$is_language?'當前價格':'Current price'}</p>
        </a>
        <a href="javascript:;" class="weui-grid buyproduct" style="background: #F44444;width: 50%;">
            <p class="buy">{$is_language?'買入資產':'Buying assets'}</p>
        </a>
        {/if}

    </div>
</footer>

<!--购买/融资选择弹出框开始-->
<div class="select-dlog">
    <div class="dlog">
        <div class="buy-close">X</div>
        <p style="text-align: center">
            <input type="button" class="buybtn1" value="{$is_language?'全資購買':'A wholly-owned purchase'}"/>
            <!--<input type="button" class="rongzi" value="{$is_language?'申請融資':'Apply for financing'}"/>-->
        </p>
        </form>
    </div>
</div>

<!--购买資產的弹出框开始-->
<div class="buy-dlog">
    <div class="dlog">
        <div class="buy-close">X</div>
        <form action="{:url('goods/order')}" method="post" class="buyForm">
            <input type="hidden" name="id" value="{$data.id}" id="hiddid">
            <p style="text-align: left;margin-left: 0.8rem;">
                <label>{$is_language?'數量':'number'}：</label>
                <input type="number" class="numInput" name="sum" value="1">
            </p>
            <div style="margin-left: 0.8rem;">
                <span>{$is_language?'注：您需支付手續費':'Note: you have to pay the handling fee'}$<span id="shouxu"></span>，{$is_language?'總支付':'Total'}$<span id="zong"></span>。</span>
            </div>
            <label for="1" style="margin-left: .8rem" hidden>{$is_language?'買漲':'Buy up'}<input type="radio" name="buy_type" id="1" value="1" checked></label>
            <!--<label for="2">{$is_language?'做空':'Short'}<input type="radio" name="buy_type" id="2" value="2"></label>-->
            <p>
                <input type="button" class="buybtn" value="{$is_language?'提交訂單':'Submit'}"/>
            </p>
        </form>
    </div>
</div>
<!--购买資產的弹出框结束-->
<script type="text/javascript">
    $(document).on("change",'select#yy',function(){
        var yy = $(this).val();
        console.log(yy)
        var url = "{:url('index/language')}";
        $.post(url,{language:yy},function (res) {
            window.location.reload();
        })
    });
</script>
{$is_language? '<script src="__MODULE_LIBS__/js/zoushitu1.js"></script>':'<script src="__MODULE_LIBS__/js/zoushitu.js"></script>'}
</body>
</html>
